import unicodedata


def calculate_display_length(s):
    """计算字符串的显示长度（全角字符计为2，控制字符忽略）"""
    return sum(2 if unicodedata.east_asian_width(c) in ['F', 'W'] else 1
               for c in s
               if not unicodedata.category(c).startswith('Cc'))


if __name__ == '__main__':
    test_cases = [
        ("Hello World", 11),
        ("你好世界", 8),
        ("Pythonの文字列", 13),  # 'の'是宽字符
        ("混合\t测试\nCase", 9)  # 过滤\t和\n
    ]

    for s, expected in test_cases:
        result = calculate_display_length(s)
        print(f"'{s}' => 计算值:{result} | 预期:{expected} | {result == expected}")
